package cn.com.surker.material.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 材料出库日志
 * </p>
 *
 * @author admin
 * @since 2023-11-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class MaterialOutboundLog implements Serializable {

    private static final long serialVersionUID = 1L;

	public MaterialOutboundLog() {}
	public MaterialOutboundLog(Long materialId, Long outboundId, Long storageId, Long orgId, Double num, String unit, Integer status, Date createTime, Long creater, Date updateTime, Long updater, String remarks) {
		this.materialId = materialId;
		this.outboundId = outboundId;
		this.storageId = storageId;
		this.num = num;
		this.unit = unit;
		this.status = status;
		this.orgId = orgId;
		this.createTime = createTime;
		this.creater = creater;
		this.updateTime = updateTime;
		this.updater = updater;
		this.remarks = remarks;
	}

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 材料信息
     */
    private Long materialId;

    /**
     * 领用记录ID
     */
    private Long outboundId;

    /**
     * 入库记录ID
     */
    private Long storageId;
    private Long orgId;

    /**
     * 数量
     */
    private Double num;

    /**
     * 领用类型(0：领用、1：离职转入、2：入职转入、3：流程转入、4：资产清理)
     */
    private Integer type;

    /**
     * 单位
     */
    private String unit;

    /**
     * 状态(0:启用1:禁用)
     */
    private Integer status;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 创建人员
     */
    private Long creater;

    /**
     * 修改时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 修改人员
     */
    private Long updater;

    /**
     * 备注
     */
    private String remarks;

	/**
	 * 不含税单价
	 */
	@TableField(exist = false)
	private BigDecimal unitPrice;

	/**
	 * 含税单价
	 */
	@TableField(exist = false)
	private BigDecimal taxUnitPrice;

}
